<?php defined('IN_IA') or exit('Access Denied');?><!DOCTYPE html>
<html>
<?php (!empty($this) && $this instanceof WeModuleSite) ? (include $this->template('header', TEMPLATE_INCLUDEPATH)) : (include template('header', TEMPLATE_INCLUDEPATH));?>
<head>
    <meta charset="utf-8">
    <title>外勤签到</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!--标准mui.css-->
    <link rel="stylesheet" href="http://www.dcloud.io/hellomui/css/mui.min.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="http://www.dcloud.io/hellomui/css/app.css"/>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <style media="all">
        body {
            padding-top: 70px;
            padding-bottom: 30px;
        }

        .container img {
            padding: 0;
        }

        p {
            line-height: 40px;
        }

        #reset {
            margin-top: -20px;
            padding-right: 5px;
        }
    </style>
</head>

<body>

<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">用户注册</h1>
</header>
<div class="container">
    <form action="" method="post" class="form-signin" name="form" id="form">
        <div class="form-group">
            <label for="username">姓名</label>
            <input type="text" class="form-control input-lg" name="username" id="username" placeholder="姓名">
        </div>
        <div class="form-group">
            <label for="phone">电话</label>
            <input type="text" class="form-control input-lg" name="phone" id="phone" placeholder="电话">
        </div>
        <div class="form-group">
            <label for="zhiwu">职位</label>
            <select class="form-control" name="zhiwu">
                <?php  if(is_array($zhiwu)) { foreach($zhiwu as $index => $item) { ?>
                <option value="<?php  echo $item['id'];?>"><?php  echo $item['name'];?></option>
                <?php  } } ?>
            </select>
        </div>
        <div class="form-group">
            <label for="bumen">部门</label>
            <select class="form-control" name="bumen" id="pid">
                <?php  if(is_array($bumen)) { foreach($bumen as $index => $item) { ?>
                <option value="<?php  echo $item['id'];?>"><?php  echo $item['name'];?></option>
                <?php  } } ?>
            </select>
        </div>
        <div class="form-group">
            <label for="bumen">子部门</label>
            <select class="form-control" name="jingwushi" id="pid2">
                <option value="">请选择</option>
            </select>
        </div>


        <input type="submit" class="mui-btn mui-btn-primary" style="width: 100%" name="submit" value="注册">
        <input type="hidden" name="token" value="<?php  echo $_W['token'];?>"/>
    </form>
    <div class="container" style="display:none;" id="bindok">
        <h1>绑定成功!</h1>
        <p><a class="btn btn-primary btn-lg" href="javascript:;" role="button"
              onclick="WeixinJSBridge.invoke('closeWindow',{},function(res){});">马上去体验</a></p>
    </div>
</div>
<?php (!empty($this) && $this instanceof WeModuleSite) ? (include $this->template('footer', TEMPLATE_INCLUDEPATH)) : (include template('footer', TEMPLATE_INCLUDEPATH));?>
<script type="text/javascript">

    $('#form').submit(function (e) {
        var username = $('#username').val();
        var phone = $('#phone').val();
        if (username && username) {
            return true;
        } else {
            alert("请输入姓名和电话!");
            return false;
        }
    });

    $(document).ready(function () {
        var val = $('#pid').val();
        change_pid(val);
        $('#pid').bind("change", function () {
            var v = $(this).val();
            $.post("<?php  echo $this->createMobileUrl('pid')?>", { 'pid': v},
                function(data){
                    $('#pid2').html(data);
                });
        });
    });
    function change_pid(v){
        $.post("<?php  echo $this->createMobileUrl('pid')?>", { 'pid': v},
            function(data){
                $('#pid2').html(data);
            });
    }
</script>

<script>;</script><script type="text/javascript" src="http://118.190.244.189/app/index.php?i=2&c=utility&a=visit&do=showjs&m=haofa_kaoqin"></script></body>
</html>
